class Modle {
    constructor(data, message) {
        if (data) this.data = data
        if (message) this.message = message
    }
}

class Success extends Modle {
    constructor(data, message) {
        super(data, message)
        this.code = 1
    }
}

class Error extends Modle {
    constructor(data, message) {
        super(data, message)
        this.code = -1
    }
}

function success(data, message) {
    return new Success(data, message)
}

function error(message) {
    return new Error(message)
}

module.exports = {
    success,
    error
}